package com.forecasting.model;

import java.io.Serializable;

public class PartNumber implements Comparable<PartNumber>,Serializable{
	private String uniqueID = null;
	private String name = "default";
	private String description = "N/A";
	
	private double leadtime = 0;
	private double forecast = 0;
	private int rop = 0;
	private double standardDeviation = 0;
	
	// can be used only if Poisson Distribution is used
	public PartNumber (String uniqueID, String name, String description, double leadtime,
			double forecast, int rop) {
		super();
		this.uniqueID = uniqueID.trim();
		if(name != null && name.length() > 0){
			this.name = name.trim();
		}
		if(description != null && description.length() > 0){
			this.description = description.trim();
		}
		//needs to be based on monthly data
		this.leadtime = leadtime;
		//needs to be based on monthly data
		this.forecast = forecast;
		this.rop = rop;
	}
	public PartNumber(String uniqueID,String name, String description, double leadtime,
			double forecast, int rop, double standardDeviation) {

		this(uniqueID,name,description,leadtime,forecast,rop);
		//need to define how to calculate
		this.standardDeviation = standardDeviation;
	}
	public String getUniqueID() {
		return uniqueID;
	}
	public String getName() {
		return name;
	}
	public String getDescription() {
		return description;
	}
	public double getLeadtime() {
		return leadtime;
	}
	public void setLeadtime(double leadtime) {
		this.leadtime = leadtime;
	}
	public double getForecast() {
		return forecast;
	}
	public void setForecast(double forecast) {
		this.forecast = forecast;
	}
	public int getRop() {
		return rop;
	}
	public void setRop(int rop) {
		this.rop = rop;
	}
	public double getStandardDeviation() {
		return standardDeviation;
	}
	public void setStandardDeviation(double standardDeviation) {
		this.standardDeviation = standardDeviation;
	}
	@Override
	public String toString() {
		String resStr = "ID: " + uniqueID + " Name: " + name + " Desc.: " + description;
		return resStr;
	}
	public String toStringLong() {
		String resStr = "ID: " + uniqueID + " Name: " + name + " Desc.: " + description;
		resStr = resStr + "\n" + "LeadTime: " + leadtime + " Forecast: " + forecast + " ROP: " + rop;
		return resStr;
	}
	@Override
	public int compareTo(PartNumber pn) {
		
		return this.uniqueID.compareToIgnoreCase(pn.getUniqueID());
	}
	
}
